
package ro.qi.framework.sys.media.entities;

import ro.qi.framework.sys.entities.Entity;

/**
 * @deprecated
 * @author George Pogorelschi
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class MediaCategories extends Entity {

	public MediaCategories() {
		super();
		setMediaTableName(getTableName());
	}

	public MediaCategories(int id) {
		super();
		setMediaTableName(getTableName());
		setParentId(id);
		select();
	}

	protected String getTableName() {return "";}

	public void setMediaTableName(String value) {setValue("mediaTableName", value);}
	public void setParentId(int value) {setValue("parentId", value);}
	public int getParentId() {return getIntValue("parentId");}

	public int getNoChilds() {return getCollectionSize("childs");}
	public int getChildId(int index) {return getCollectionIntValue("childs", "childId", index);}
	public String getChildName(int index) {return getCollectionStringValue("childs", "childName", index);}
	public MediaCategories getChild(int index) {
		int childId = getChildId(index);
		if( childId > 0 )
			return new MediaCategories(childId);
		return null;
	}

	public int getNoMedia() {return getCollectionSize("mediaIds");}
	public int getMediaId(int index) {return getCollectionIntValue("mediaIds", "mediaId", index);}
	public String getMediaName(int index) {return getCollectionStringValue("mediaIds", "mediaName", index);}
	public int getMediaHeight(int index) {return getCollectionIntValue("mediaIds", "mediaHeight", index);}
	public int getMediaWidth(int index) {return getCollectionIntValue("mediaIds", "mediaWidth", index);}
	public String getMediaContentType(int index) {return getCollectionStringValue("mediaIds", "mediaContentType", index);}
	public int getMediaContentLength(int index) {return getCollectionIntValue("mediaIds", "mediaContentLength", index);}

}
